1. Field of the Invention
This invention relates to a file system for a flash memory which writes and reads out data into and from the flash memory, for example, in a data exchange.
2. Description of the Related Art
Conventionally, in a file system in which a flash memory is used as a storage medium, reading out and writing operations of a file between a plurality of physical blocks formed in the flash memory and a plurality of logic blocks individually corresponding to the physical blocks of the flash memory are performed in the following manner by a flash memory read/write driver.
The file system itself calculates, when it tries to perform reading out or writing of data from or into a logic block controlled by it, a logic block designated by application software and an offset in the logic block and develops a read-out or write request to the flash memory read/write driver based on the thus calculated data.
The flash memory read/write driver refers to a correspondence table which describes a correspondence relationship between logic blocks and physical blocks of the flash memory to convert the designated logical block and the offset in the logic block into a physical block. Then, a corresponding physical block and an offset in the physical block are calculated, and contents of the logic block are read out and written into the physical block.
By the way, a flash memory has a limitation to the number of re-write times by which data can be written regularly into each physical block thereof.
However, since the conventional file system for a flash memory does not take the limitation to the number of re-write times described above into consideration, it has a drawback in that, when writing of a file so concentrates on a particular physical block that the number of times by which writing into the physical block occurs exceeds the limitation number of re-write times, the file system itself is disabled suddenly. It is to be noted that the limitation number of re-write times is an upper limit value to the number of times by which writing of a file into a physical block can be performed regularly.
Although a possible solution to the problem is to exchange the flash memory before the file system itself becomes disabled suddenly, it is impossible with the conventional file system to estimate the time at which the flash memory should be exchanged.